{template 'common/header'}
<style type="text/css">
.mui-bar a{color: #ff9900;}
.mui-btn-primary{background-color: #ff9900;}
.mui-btn-primary:enabled:active{background-color: #ec7230!important;}
.mui-textarea{ height:auto!important; width:100%;background-color: #FFF!important;}
.area {margin: 20px auto 0px auto;}
.mui-input-group:first-child {margin-top: 20px;}
.mui-rmb i{ font-style:normal; }
.mui-input-row #get_code{ padding:8px; width:auto; border-radius: 0;line-height: 1.7;}
.mui-help-top{ margin-bottom:10px;margin-top:0;}
.mui-help-top .mui-table-view-cell{padding: 9px 12px;}
.mui-help-top .mui-icon-help:before{ color:#fe5001; font-size:18px;top:45%;}
.mui-help-top .mui-small{ font-size:85%!important;}
.mui-help-top .mui-help-info:before{position: absolute;content: ""; height:99%!important;left:0;top:0;width:3px; background-color:#fe5001;}
.mui-input-row label,.mui-input-row .mui-label{color:#6e6e6e;}
.mui-input-row label~input{text-align:right}
.mui-input-row .mui-input-inline{ position:relative; width:27%; height:40px;line-height: 40px; text-align:center}
.mui-input-row .mui-input-inline input{padding: 0;}
.mui-input-row .mui-input-inline:last-child input{ text-align:right;}
[data-type=date] .mui-dtpicker-title h5, [data-type=date] .mui-picker{width: 20%!important;}
.mui-dtpicker-title h5,.mui-picker{ display:inline-block!important;}
.mui-table-view-cell label {font-family:"Microsoft Yahei","微软雅黑",Arial,"Hiragino Sans GB","宋体","Helvetica Neue",Helvetica,sans-serif;white-space:nowrap;text-overflow:ellipsis;}
footer .mui-input-row{ height:49px!important; border:none;}
footer .mui-input-row label{line-height:2; padding:11px 0; text-align:right; float:right;}
footer .mui-input-row span{line-height:2; padding:11px 10px 11px 0;}
footer .mui-input-row span.mui-rmb{line-height:1.8!important;}
footer .mui-input-row .mui-btn{top: 0; font-size:16px;line-height:1.6!important;border-radius:0; width:35%}
footer.mui-bar{box-shadow:none;}
footer.mui-bar:before{position: absolute;left: 0;right: 0;height: 0.5px; background-color: #D9D9D9;content: "";top: -0.6px;}
.map-container{position: fixed;top: 0; left:0;bottom: 0; right:0;z-index: 11;height:auto;overflow: hidden; background:#FFF;}
.map-container iframe{width:100%;height:100%; padding-bottom:60px;border: none;}
</style>
<form class="formmain" action="" method="post" onSubmit="return check(this);return false;" style="position: initial">
<footer class="mui-bar mui-bar-tab">
    <div class="mui-content-padded" style="margin-top:0px;">
        <input type="submit" name="submit" class="mui-btn mui-btn-orange mui-btn-block js-submit" value="发布活动"/>
    </div>
    <input type="hidden" name="op" value="post"/>
    <input type="hidden" name="activityid" value="{$activityid}" />
    <input type="hidden" name="token" value="{$_W['token']}" />
</footer>
<div class="mui-content">
    <ul class="mui-table-view mui-help-top" style="margin-top:0;">
        <li class="mui-table-view-cell mui-help-info">
            <span class="mui-navigate-left mui-icon-help mui-text-orange mui-small"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 提醒：凡是“必填”，或者“*”号的为必填选项</span>
        </li>
    </ul>
	<div class="mui-content-padded">
        <p class="mui-pl5">基本信息</p>
    </div>
	<div class="mui-input-group">
        <div class="mui-input-row">
            <label>活动名称</label>
            <input type="text" name="activity[title]" id="name" placeholder="(必填)" value="{$activity['title']}">
        </div>
        <div class="mui-input-row">
            <label>顶部标题</label>
            <input type="text" name="activity[pagetitle]" id="name" placeholder="显示在顶部标题栏 (选填)" value="{$activity['pagetitle']}">
        </div>
        <div class="mui-input-row">
            <label>报名费用</label>
            <input type="number" name="activity[aprice]" id="name" placeholder="(不填写视为免费)" value="{$activity['aprice']}">
        </div>
        <div class="mui-input-row">
        	<label>报名时间</label>
            <div class="mui-input-inline mui-pull-left">
			<input class="mui-calendar-picker1" type="text" placeholder="开始时间" value="{php echo empty($activity['joinstime'])?'':date('m-d H:i',strtotime($activity['joinstime']))}" readonly>
            <input type="hidden" value="{$activity['joinstime']}" name="activity[joinstime]">
            <script type="text/javascript">
				$(document).on("tap", ".mui-calendar-picker1", function(){
					var $this = $(this);
					util.datepicker({type: "date", beginYear: 2000, endYear: 2050}, function(rs){
						$this.val(rs.m.value + '-' + rs.d.value + ' ' + rs.h.value + ':' + rs.i.value)
						.next().val(rs.value + ' ' + rs.h.value + ':' + rs.i.value)
					});
				});
			</script>
            </div>
            <div class="mui-input-inline mui-pull-left" style="width:5%">~</div>
            <div class="mui-input-inline mui-pull-left">
			<input class="mui-calendar-picker2" type="text" placeholder="结束时间" value="{php echo empty($activity['joinetime'])?'':date('m-d H:i',strtotime($activity['joinetime']))}" readonly>
            <input type="hidden" value="{$activity['joinetime']}" name="activity[joinetime]">
            <script type="text/javascript">
				$(document).on("tap", ".mui-calendar-picker2", function(){
					var $this = $(this);
					util.datepicker({type: "date", beginYear: 2000, endYear: 2050}, function(rs){
						$this.val(rs.m.value + '-' + rs.d.value + ' ' + rs.h.value + ':' + rs.i.value)
						.next().val(rs.value + ' ' + rs.h.value + ':' + rs.i.value)
					});
				});
			</script>
            </div>
        </div>
        <div class="mui-input-row">
        	<label>活动时间</label>
            <div class="mui-input-inline mui-pull-left">
			<input class="mui-calendar-picker3" type="text" placeholder="开始时间" value="{php echo empty($activity['starttime'])?'':date('m-d H:i',strtotime($activity['starttime']))}" readonly>
            <input type="hidden" value="{$activity['starttime']}" name="activity[starttime]">
            <script type="text/javascript">
				$(document).on("tap", ".mui-calendar-picker3", function(){
					var $this = $(this);
					util.datepicker({type: "date", beginYear: 2000, endYear: 2050}, function(rs){
						$this.val(rs.m.value + '-' + rs.d.value + ' ' + rs.h.value + ':' + rs.i.value)
						.next().val(rs.value + ' ' + rs.h.value + ':' + rs.i.value)
					});
				});
			</script>
            </div>
            <div class="mui-input-inline mui-pull-left" style="width:5%">~</div>
            <div class="mui-input-inline mui-pull-left">
			<input class="mui-calendar-picker4" type="text" placeholder="结束时间" value="{php echo empty($activity['endtime'])?'':date('m-d H:i',strtotime($activity['endtime']))}" readonly>
            <input type="hidden" value="{$activity['endtime']}" name="activity[endtime]">
            <script type="text/javascript">
				$(document).on("tap", ".mui-calendar-picker4", function(){
					var $this = $(this);
					util.datepicker({type: "date", beginYear: 2000, endYear: 2050}, function(rs){
						$this.val(rs.m.value + '-' + rs.d.value + ' ' + rs.h.value + ':' + rs.i.value)
						.next().val(rs.value + ' ' + rs.h.value + ':' + rs.i.value)
					});
				});
			</script>
            </div>
        </div>
        <div class="mui-input-row">
            <label>是否上线</label>
            <p class="mui-pull-left" style="line-height:40px; color:#a9a9a9">审核通过直接上线</p>
            <div class="mui-switch mui-switch-mini{php echo $activity['show']==1?' mui-active':''}">
                <div class="mui-switch-handle"></div>
                <input type="hidden" name="activity[show]" value="{php echo $activity['show']==1?1:0}">
            </div>
        </div>
        <p></p>
        <div class="mui-textarea">
           <textarea id="textarea" class="mui-input-clear" name="activity[intro]" placeholder="在此输入简要概述(建议30个字符左右)">{$activity['intro']}</textarea>
        </div>
        <p></p>
        <link rel="stylesheet" type="text/css" href="{aide_URL}app/resource/components/editormobile/dist/css/wangEditor-mobile.css?v=20170716">
        <style type="text/css">
        .noscroll,.noscroll body,.noscroll .mui-content {overflow: hidden!important;}
		.noscroll nav { display:none!important}
		.container {background-color:#FFF; min-height:120px;max-height:280px; overflow:auto;}
		.wangEditor-mobile-txt{min-height:120px; padding:0 15px;}
		.wangEditor-mobile-txt img{margin:0!important;max-width: 100%;height: auto!important;vertical-align: bottom;font-size: 0;}
		.wangEditor-mobile-menu-container{top: 0!important;left: 0!important;right: 0;border-radius:0px!important;max-width:100%;opacity: 0.9!important; display:block; position:fixed;}
		.wangEditor-mobile-menu-container .tip{ display:none;}
		.wangEditor-mobile-modal{ max-height:180px; overflow:auto; z-index:999;}
		.command-color{width:25px;height:25px;display:inline-block;border-radius:2px;margin: 4px;line-height: 26px;text-align: center;}
		.placeholder:before{content:attr(placeholder);font-size: 14px;position:absolute;z-index:2;top:3px;color:#a9a9a9;}
		.placeholder:focus{content:none;}
		.mui-editor{ padding:10px 0 10px 0; background-color:#fff;}
		.mui-editor footer{display:none; text-align:center}
		.mui-editor .mui-help-top{ display:none;}
		.text-editor.container{position: fixed;top: 0; left:0;bottom: 0; right:0;z-index: 11;height:auto;max-height:100%;overflow: hidden;}
		.text-editor footer~.wangEditor-mobile-txt { margin-bottom: 50px;}
		.text-editor .wangEditor-mobile-txt{ -webkit-overflow-scrolling: touch; position: absolute;top: 48px;bottom: 0; height:auto;overflow: auto;padding:0 10px;}
		.text-editor .mui-help-top{ display: block;}
		.text-editor footer{ display:inline-table;}
		.nolength .wangEditor-mobile-txt p{ height:100%;}
		</style>
        <div class="mui-editor">
            <div class="container">
                <footer class="mui-bar mui-bar-tab">
                    <div class="mui-content-padded" style="margin-top:0px;">
                        <span class="mui-btn mui-btn-success mui-btn-block mui-btn-outlined end-editor">编辑完成点击进行下一步</span>
                    </div>
                </footer>
                <ul class="mui-table-view mui-help-top">
                    <li class="mui-table-view-cell mui-help-info">
                        <span class="mui-navigate-left mui-icon-help mui-text-orange mui-small"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 提醒：编辑样式，请点击当前行，选择工具</span>
                    </li>
                </ul>
                <textarea id="textarea1" style="width:100%;height:100%;" name="activity[detail]">{$activity['detail']}</textarea>
            </div>
        </div>
        <p></p>
        <ul class="mui-table-view mui-afterbefore-no" style="margin-top:0;">
        	<li class="mui-table-view-cell mui-media js-popover" data-popover='act_setting'>
                <a class="mui-navigate-right js-setting">
                    <p style="padding-left:6px;margin-right:35px;font-size:14px;color:#6e6e6e">报名设置</p>
                    <span class="mui-badge mui-badge-inverted"></span>
                </a>
            </li>
            {if $_W['_config']['cateswitch']}
            <li class="mui-table-view-cell mui-media">
                <a class="mui-navigate-right js-category-options">
                    <p style="padding-left:6px;margin-right:35px;font-size:14px;color:#6e6e6e">活动类型</p>
                    <span class="mui-badge mui-badge-inverted js-category">
                    {if $activityid}
                    {loop $category[0] $v}
                    	{if $v['value']==$activity['parentid']}
                        	{$v['text']}
                            {loop $v['children'] $child}
                            	{if $child['value']==$activity['childid']},{$child['text']}{php break;}{/if}
                            {/loop}
                            {php break;}
                        {/if}
                    {/loop}
                    {else}
                    	(必填)
                    {/if}
                    </span>
                </a>
                <input type="hidden" value="{$activity['parentid']}" name="activity[parentid]">
            	<input type="hidden" value="{$activity['childid']}" name="activity[childid]">
                <script type="text/javascript">
					$(".js-category-options").on("tap", function(){
						var options = {data: {php echo json_encode($category[0])},layer:2};
						var $this = $(this);
						util.poppicker(options, function(items){
							var checkText;
							checkText = items[1].value!="undefined" ? items[0].text+", "+items[1].text : items[0].text;
							$this.find('.js-category').text(checkText);
							$this.next().val(items[0].value).next().val(items[1].value!="undefined" ? items[1].value:0);
						});
					});
				</script>
            </li>
            {/if}
            <li class="mui-table-view-cell mui-media js-popover" data-popover='map_selector'>
                <a class="mui-navigate-right js-address">
                    <div class="mui-media-body">
                        <span class="mui-ellipsis-2" style="padding-left:6px;margin-right:35px;font-size:14px;color:#6e6e6e">设置场地</span>
                    </div>
                    <span class="mui-badge mui-badge-inverted mui-ellipsis-2" style="max-width:60%;line-height:1.2;text-align:right;">
                    {if $activity['hasonline']}线上活动{else}{php echo empty($activity['address'])?'(必填)':$activity['address']}{/if}
                    </span>
                    <input type="hidden" value="{$activity['address']}" name="activity[address]" />
                    <input type="hidden" value="{$activity['lat']}" name="activity[lat]" />
                    <input type="hidden" value="{$activity['lng']}" name="activity[lng]" />
                    <input type="hidden" value="{$activity['adinfo']}" name="activity[adinfo]" />
                    <input type="hidden" value="{php echo $activity['hasonline']?1:0}" name="activity[hasonline]" />
                </a>
            </li>
            <li style="display:none"></li>
        </ul>
        <div class="mui-input-row js-addname" style="{if $activity['hasonline'] || $activity['hasonline']==''}display:none{/if}">
            <label>场地名称</label>
            <input type="text" name="activity[addname]" placeholder="例如XXX大厦 (必填)" value="{$activity['addname']}">
        </div>
        <div class="mui-input-row">
            <label>咨询电话</label>
            <input type="number" name="activity[tel]" id="name" placeholder="咨询电话 (必填)" value="{$activity['tel']}">
        </div>
        <p></p>
        <div class="mui-input-cell">
            <div class="mui-table-view-chevron">
                <div class="mui-image-uploader">
                    <div class="mui-image-preview js-image-preview">
                    	<div class="file-item js-thumb"{php echo empty($activity['thumb'])?'style="display:none;"':''}>
                        <img src="{php echo empty($activity['thumb'])?aide_URL.'app/resource/images/nopic.jpg':tomedia($activity['thumb'])}" data-id="{php echo attachment_id($activity['thumb'])}" data-preview-src="{php echo tomedia($activity['thumb'])}" data-preview-group="__IMG_UPLOAD_pic"/>
                        <input type="hidden" value="{$activity['thumb']}" id="pic" name="activity[thumb]" />
                        <div class="file-panel"><span>×</span></div>
                    	</div>
                    </div>
                    <a href="javascript:;" class="mui-upload-btn js-image-pic mui-inline"></a>
                    <label class="mui-block"><span class="mui-badge mui-badge-inverted" style="padding:0;">请上传清晰的图片,建议图片尺寸640*300 <font class="mui-text-error"> *</font></span></label>
                </div>
                <script>
                    var obj=".js-image-pic";
                    util.img(obj, function(url){
                        $(obj).parent().find('.js-image-preview').find('#pic').val(url.attachment);
                        $(obj).parent().find('.js-image-preview').find('img').attr("src",url.url);
                        $(obj).parent().find('.js-image-preview').find('img').attr("data-id",url.id);
                        $(obj).parent().find('.js-image-preview').find('img').attr("data-preview-src",url.url);
						$(obj).parent().find('.js-image-preview').find('.js-thumb').show();
                    }, {
                        crop : true,
                        multiple : false,
                        preview : '__IMG_UPLOAD_pic',
						aspectRatio:16/9,
						resizable:1
                    });
					setTimeout(function(){
                       $('.js-image-pic').append('<div class="btn-intro" style="position:absolute;color:#d7d7d7;top:54px;line-height:1.2;left:0;right:0;">封面图<br>(最多1张)</div>');
                    },1500);
                </script>
            </div>
        </div>
        <div class="mui-input-cell">
            <div class="mui-table-view-chevron">
                <div class="mui-image-uploader">
                    <div class="mui-image-preview js-image-nopic mui-pull-left" style="display:none">
                        <img src="{aide_URL}app/resource/images/nopic.jpg"/>
                    </div>
                    <div class="mui-image-preview js-image-preview">
                    	{if !empty($activity['atlas'])}
                        	{loop $activity['atlas'] $url}
                            <div class="file-item js-thumb-item">
                        	<input type="hidden" value="{$url}" name="activity[atlas][]" />
                            <img src="{php echo tomedia($url)}" data-id="{php echo attachment_id($url)}" data-preview-src="{php echo tomedia($url)}" data-preview-group="__IMG_UPLOAD_image" />
                            <div class="file-panel"><span>×</span></div>
                            </div>
                            {/loop}
                        {/if}
                    </div>
                    <a href="javascript:;" class="mui-upload-btn js-image-atlas mui-inline"></a>
                    <label class="mui-block"><span class="mui-badge mui-badge-inverted" style="padding:0;">请上传清晰的图片,建议图片尺寸640*300 <font class="mui-text-error"> *</font></span></label>
                </div>
                <script>
                    var objs=".js-image-atlas";
                    util.img(objs, function(url){
                        $(objs).parent().find('.js-image-preview').append('<div class="file-item js-thumb-item"><input type="hidden" value="'+url.attachment+'" name="activity[atlas][]" /><img src="'+url.url+'" data-id="'+url.id+'" data-preview-src="'+url.url+'" data-preview-group="__IMG_UPLOAD_image"/><div class="file-panel"><span>×</span></div></div>');
                        $(".js-image-nopic").hide();
                    }, {
                        crop : true,
                        multiple : false,
                        preview : '__IMG_UPLOAD_image',
						aspectRatio:16/9,
						resizable:1
                    });
					setTimeout(function(){
                       $('.js-image-atlas').append('<div class="btn-intro" style="position:absolute;color:#d7d7d7;top:54px;line-height:1.2;left:0;right:0;">活动图集<br>(最多8张)</div>')
                    },1500);
                </script>
                <p></p>
            </div>
        </div>
        <p>&nbsp;</p>
        {if $_W['_config']['agreement']}
        <div class="mui-content-padded">
            <div class="mui-checkbox mui-agreement js-popover" data-popover="agreement">
                <input name="agreement" value="1" type="checkbox"><label>已阅读并同意《<a>活动发布协议</a>》</label>
            </div>
        </div>
        <p>&nbsp;</p>
        {/if}
    </div>
</div>
{template 'member/setting'}
</form>
<script type="text/javascript" src="{aide_URL}app/resource/components/editormobile/dist/js/lib/zepto.js"></script>
<script type="text/javascript" src="{aide_URL}app/resource/components/editormobile/dist/js/lib/zepto.touch.js"></script>
<script type="text/javascript" src="{aide_URL}app/resource/components/editormobile/dist/js/wangEditor-mobile.js?v=20171116"></script>
<script type="text/javascript">
$(function () {
	$('input[type=text]').each(function(key){
		if ($(this).attr("readonly")) $(this).attr('onfocus','this.blur()');
	});
	var wHeight = window.innerHeight;//获取初始可视窗口高度
	// ___E 三个下划线
	var editor = new ___E('textarea1');
	editor.config.menus = ['head','bold','color','quote','center','list','img','happy'];
	editor.config.uploadImgUrl = "{php echo app_url('utility/file/upload')}";
	editor.config.uploadTimeout = 20 * 10000;     // 设置为 20s
	editor.init();
	var text = $('#textarea1').text();
	if (text.length == 0){
		$('.container').addClass('nolength');
	}
	$('.end-editor').on('click',function(e){
		$('.container').removeClass("text-editor");
		$('html').removeClass("noscroll");
	});
	$('.wangEditor-mobile-txt').on('tap',function(e){
		$('.container').addClass("text-editor");
		$('.container').removeClass('nolength');
		$('html').addClass("noscroll");
		if (util.ios()){
			var target = this;
			setTimeout(function(){
				target.scrollIntoViewIfNeeded(true);
				target.scrollIntoViewIfNeeded(false);
			},50);
			setTimeout(function(){$(".wangEditor-mobile-txt").height(wHeight/2-95)},200);
			$(window).scroll(function(){
				$(window).scrollTop(false);
			});
		}
	});
	$('.wangEditor-mobile-txt').on('blur',function(e){
		var text = $('.wangEditor-mobile-txt').text();
		if (text.length > 0){
			$('.wangEditor-mobile-txt').removeClass('placeholder');
		}else{
			$('.container').addClass('nolength');
		}
		if (util.ios()){
			$(".wangEditor-mobile-txt").height('auto');
			$(".wangEditor-mobile-txt")[0].offsetHeight;
			$(window).unbind("scroll");
		}
	});
	if (!util.ios()){
		//激活编辑模式禁用window滚动
		window.addEventListener('resize', function(){//监测窗口大小的变化事件
			var hh = window.innerHeight;//当前可视窗口高度
			var viewTop = $(window).scrollTop();//可视窗口高度顶部距离网页顶部的距离
			if(wHeight > hh && $("html").hasClass("noscroll")){//可以作为虚拟键盘弹出事件
				//$(".content").animate({scrollTop:viewTop+100});    //调整可视页面的位置
				$(".wangEditor-mobile-txt").height(hh-60);
				$(window).scroll(function(){
					$(window).scrollTop(false);
				});
			}else{         //可以作为虚拟键盘关闭事件
				$(".wangEditor-mobile-txt").height('auto');
				$(window).unbind( "scroll" );
				//$(".content").animate({scrollTop:viewTop-100});
			}
			wHeight = hh;
		});
	}
	//开关
	$('.mui-switch').on('tap',function(e){
		if ($(this).hasClass("mui-active")){
			$(this).find('input').val(1);
		}else{
			$(this).find('input').val(0);
		}
		//console.log("你启动了开关");
	});
	//删除图片
	$('.js-image-preview').delegate(".file-panel span","tap",function(e){
		var attachid = $(this).parent().siblings('img').attr('data-id');
		var $this = $(this);
		util.loading();
		$.post("{php echo app_url('utility/file/delete')}", {id: attachid}, function(data) {
			util.loading().close();
			if(!data.error){
				$this.parents('.js-thumb-item').remove();
				$this.parents('.js-thumb').hide();
				$this.parents('.js-thumb').find('input').val('');
			}
			//util.toast(data.message);
		}, 'json');
		console.log("你删除了一张图片");
	});
});
//表单验证
var checksubmit = false;
function check(form) {
	if (!form['activity[title]'].value) {
		util.alert('请输入活动名称', ' ', function() {
			$("input[name='activity[title]']").focus();
		});
		return false;
	}
	if (!form['activity[joinstime]'].value) {
		util.alert('请输入报名开始时间', ' ', function() {
			$(".mui-calendar-picker1").trigger('tap');
		});
		return false;
	}
	if (!form['activity[joinetime]'].value) {
		util.alert('请输入报名结束时间', ' ', function() {
			$(".mui-calendar-picker2").trigger('tap');
		});
		return false;
	}
	if (!form['activity[starttime]'].value) {
		util.alert('请输入活动开始时间', ' ', function() {
			$(".mui-calendar-picker3").trigger('tap');
		});
		return false;
	}
	if (!form['activity[endtime]'].value) {
		util.alert('请输入活动结束时间', ' ', function() {
			$(".mui-calendar-picker4").trigger('tap');
		});
		return false;
	}
	if (!form['activity[intro]'].value) {
		util.alert('简要概述不能为空', ' ', function() {
			$("textarea[name='activity[intro]']").focus();
		});
		return false;
	}
	if (!form['activity[detail]'].value) {
		util.alert('图文详情不能为空', ' ', function() {
			$(".wangEditor-mobile-txt").trigger('tap');
		});
		return false;
	}
	{if $_W['_config']['cateswitch']}
	if (form['activity[parentid]'].value=='') {
		util.alert('请设置活动类型', ' ', function() {
			$(".js-category-options").trigger('tap');
		});
		return false;
	}
	{/if}
	if (form['activity[hasonline]'].value=='0' && !form['activity[address]'].value) {
		util.alert('请设置活动场地', ' ', function() {
			$(".js-address").parent().trigger('tap');
		});
		return false;
	}
	if (form['activity[hasonline]'].value=='0' && !form['activity[addname]'].value) {
		util.alert('请输入场地名称', ' ', function() {
			$("input[name='activity[addname]']").focus();
		});
		return false;
	}
	if (!form['activity[tel]'].value) {
		util.alert('请输入联系电话', ' ', function() {
			$("input[name='activity[tel]']").focus();
		});
		return false;
	}
	if (!form['activity[thumb]'].value) {
		util.alert('请上传一张封面缩略图', ' ', function() {});
		return false;
	}
	if (typeof(form['activity[atlas][]'])=='undefined') {
		util.alert('请输上传活动图集', ' ', function() {});
		return false;
	}
	{if $_W['_config']['agreement']}
	if ($('input:checkbox[name="agreement"]:checked').length == 0) {
		util.alert('请阅读并同意活动发布协议', ' ', function() {
			$("input[name='agreement']").focus();
		});
		return false;
	}
	{/if}
	var id="{$activityid}",proreview="{php echo $_W['_config']['proreview']==1 || ($_W['_config']['proreview']==2 && $activity['aprice']==0)?1:0;}";
	if (id!='' && !checksubmit && proreview=='0'){
		util.confirm('修改后将进入审核状态，是否确认？', ' ', function(e) {
			if (e.index == 1) {
				checksubmit = true;
				$('.js-submit').trigger('click');
			}
		});
	}else{
		checksubmit = true;
	}
	return checksubmit;
}
</script>
</body>
</html>
